package com.boarsoft.boar.entity;

import java.io.Serializable;

import com.boarsoft.common.Util;

public class FileVersion implements Serializable {
	private static final long serialVersionUID = 2129470934742458632L;

	public static final short STATUS_INACTIVE = 0;
	public static final short STATUS_ACTIVE = 1;

	private String id;
	private String fileId;
	/** */
	private String env;
	/**
	 * 存储文件的相对地址，如：boar-soagov-web/conf/20200515 <br>
	 * 或远程服务的URL，如：http://............./config.properties <br>
	 * 如果是URL则经由配置中心代理访问，否则直接读取文件
	 */
	private String path = "";
	/** （应用实例）版本（灰度）分组 */
	private String group = "default";
	/** */
	private String ver;
	private short status;
	private String createTime;
	private String lastTime;
	private String memo;

	private FileInfo fileInfo;

	public static FileVersion clone(FileVersion a) {
		FileVersion o = new FileVersion();
		// o.setStatus(FileVersion.STATUS_ACTIVE);
		o.setCreateTime(Util.getStdfDateTime());
		o.setLastTime(Util.getStdfDateTime());
		o.setVer(Util.getStdmfDateTime());
		o.setEnv(a.getEnv());
		o.setFileId(a.getFileId());
		o.setMemo("auto created");
		o.setGroup(a.getGroup());
		// clone的fileVersion不能有path
		// o.setPath(a.getPath());
		return o;
	}

	public FileInfo getFileInfo() {
		return fileInfo;
	}

	public void setFileInfo(FileInfo fileInfo) {
		this.fileInfo = fileInfo;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getFileId() {
		return fileId;
	}

	public void setFileId(String fileId) {
		this.fileId = fileId;
	}

	public String getEnv() {
		return env;
	}

	public void setEnv(String env) {
		this.env = env;
	}

	public String getVer() {
		return ver;
	}

	public void setVer(String ver) {
		this.ver = ver;
	}

	public short getStatus() {
		return status;
	}

	public void setStatus(short status) {
		this.status = status;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getLastTime() {
		return lastTime;
	}

	public void setLastTime(String lastTime) {
		this.lastTime = lastTime;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}
}